home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-12-24 | 960 b | 27 lines | [TEXT/EDIT] |
- ; The following predicate takes a symbol naming a variable
- ; and returns #t if the global variable named by that variable
- ; is currently defined.
-
- ; This procedure will have to be redefined for future versions
- ; of MacScheme.
-
- (define (defined? name)
- (cond ((assq name **primops**) #t)
- (else (not (eq? (car (->pair name)) (undefined))))))
-
- ; Include macro for getting around MacScheme's 32K editor limitation.
- ; (include <filename>) macro-expands into (begin <contents of file>).
- ; The compiler flattens begin expressions that contain nothing but
- ; definitions, allowing a set of definitions to be placed in a separate
- ; file. This favors internal definitions over the letrec syntax.
-
- (macro include
- (lambda (l)
- (call-with-input-file
- (cadr l)
- (lambda (p)
- (do ((x (read p) (read p))
- (l '() (cons x l)))
- ((eof-object? x)
- (cons 'begin (reverse l))))))))
-